package com.shd.edanpei.bean;

import android.os.Parcel;
import android.os.Parcelable;

public class NeedBean implements Parcelable {

    private String name;
    private boolean isCheck;

    public NeedBean(String name, boolean isCheck) {
        this.name = name;
        this.isCheck = isCheck;
    }

    protected NeedBean(Parcel in) {
        name = in.readString();
        isCheck = in.readByte() != 0;
    }

    public static final Creator<NeedBean> CREATOR = new Creator<NeedBean>() {
        @Override
        public NeedBean createFromParcel(Parcel in) {
            return new NeedBean(in);
        }

        @Override
        public NeedBean[] newArray(int size) {
            return new NeedBean[size];
        }
    };

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        isCheck = check;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeByte((byte) (isCheck ? 1 : 0));
    }
}
